<template>
	<view class="top" @click="backTop">
		<image src="../static/otherImage/top.png"></image>
	</view>
</template>

<script>
	export default {
		props:{
			windowHeight:{
				type:Number,
				default: 0
			}
		},
		methods: {
			backTop() {
				uni.pageScrollTo({
					scrollTop: this.windowHeight + 20,
					duration: 800,
				})
			}
		},
	}
</script>

<style lang="less">
	.top {
		position: fixed;
		right: 40rpx;
		bottom: 100rpx;
		z-index: 99;

		image {
			height: 80rpx;
			width: 80rpx;
		}
	}
</style>
